import request from '../request';
const { loginServer } = window.g
/**
 * 登录
 * @param {String} username 用户名
 * @param {String} password 密码
*/
export const login = ({ username, password }) => request({
  url: `${loginServer}/login?username=${username}&password=${password}`,
  method: 'POST',
  data: { username, password }
});

/**
 * 登出
 */
export const logout = () => request({
  url: `${loginServer}/logout`,
  method: 'POST'
});
/**获取用户信息 */
export const getUser = () => request({
  url: `${loginServer}/get_user`,
  method: 'POST'
})
